restful average(Pod的扩缩容)

您所在的位置:网站首页 restful average翻译 restful average(Pod的扩缩容)

restful average(Pod的扩缩容)

2024-07-13 07:14| 来源: 网络整理| 查看: 265

本篇文章给大家谈谈restful average,以及Pod的扩缩容对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。本文目录Pod的扩缩容英语翻译If you are worried about things and are under a lot of stress求my fair lady 中文剧本what’s to become of me(my fair lady台词)Pod的扩缩容

实际生产系统, 会遇到 某个服务需要扩容 的场景,也可能会遇到由于 资源紧张 或者 工作负载降低 而需要 减少服务实例数量 的场景。

此时可以利用 Deployment/RC 的 Scale机制 来完成这些工作。

Kubernetes 对Pod的扩缩容 操作提供了 手动 和 自动 两种模式.

手动模式 通过执行 kubectl scale命令 或通过 RESTful API 对一个 Deployment/RC 进行 Pod副本数量 的设置,即可 一键完成 。

自动模式 则需要用户根据 某个性能指标 或者 自定义业务指标 ,并指定 Pod副本数量的范围 ,系统将自动在 这个范围内 根据 性能指标的变化 进行调整。

以Deployment nginx为例:

Kubernetes从1.1版本开始,新增了名为 Horizontal Pod Autoscaler(HPA )的 控制器 ,用于实现 基于CPU使用率 进行 自动Pod扩缩容 的功能。

HPA控制器 基于 Master 的 kube-controller-manager 服务 启动参数 -- horizontal-pod-autoscaler-sync-period 定义的 探测周期 (默认值为 15s ),周期性地 监测目标Pod的资源性能指标 ,并与HPA资源对象中的扩缩容条件进行对比,在 满足条件 时对Pod副本数量进行调整。

Kubernetes中的 某个Metrics Server ( Heapster 或 自定义Metrics Server )持续采集 所有Pod副本的指标数据 。

HPA控制器 通过 Metrics Server 的 API (Heapster的API或聚合API)获取这些数据,基于 用户定义的扩缩容规则 进行计算,得到 目标Pod副本数量 。

当目标Pod副本数量与当前副本 数量不同 时, HPA控制器 就向 Pod的副本控制器 ( Deployment 、 RC 或 ReplicaSet )发起 scale操作 ,调整Pod的副本数量,完成扩缩容操作。

Master的 kube-controller-manager 服务持续监测 目标Pod 的某种性能指标,以计算是否需要调整副本数量。

目前Kubernetes支持的指标类型如下。

Kubernetes从1.11版本开始, 弃用!!! 基于 Heapster组件 完成 Pod的CPU使用率 采集的机制,全面转向 基于Metrics Server 完成 数据采集 。

Metrics Server 将采集到的 Pod性能指标数据 通过 聚合API(Aggregated API )如metrics.k8s.io、custom.metrics.k8s.io和external.metrics.k8s.io提供给 HPA控制器 进行查询。

Autoscaler控制器 从 聚合API 获取到 Pod性能指标数据 之后,基于下面的算法计算出目标Pod副本数量,与当前运行的Pod副本数量进行对比,决定是否需要进行扩缩容操作:

即 当前副本数 ×( 当前指标值 / 期望的指标值 ),将 结果向上取整 。

以 CPU请求数量 为例,如果用户设置的 期望指标值为100m ,当前 实际 使用的 指标值为200m ,则计算得到期望的Pod副本数量应为两个(200/100=2)。如果设置的期望指标值为50m,计算结果为0.5,则向上取整值为1,得到目标Pod副本数量应为1个。

当计算结果与1非常接近时,可以设置一个容忍度让系统不做扩缩容操作。容忍度通过 kube-controller-manager服务 的启动参数-- horizontal-pod-autoscaler-tolerance 进行设置, 默认值为0.1 (即10%),表示基于上述算法得到的结果在区间内,即[ 0.9 - 1.1 ],控制器都不会进行扩缩容操作。

也可以将 期望指标值(desiredMetricValue )设置为指标的 平均值类型 ,例如 targetAverageValue 或 targetAverageUtilization ,此时当前指标值( currentMetricValue )的算法为 所有Pod副本当前指标值的总和 除以 Pod副本数量 得到的平均值。

此外,存在几种Pod异常的情况,如下所述。

在计算“当前指标值/期望的指标值”(currentMetricValue / desiredMetricValue)时将不会包括上述这些异常Pod

当存在缺失指标的Pod时,系统将更保守地重新计算平均值。系统会假设这些Pod在需要缩容(Scale Down)时消耗了期望指标值的100%,在需要扩容(Scale Up)时消耗了期望指标值的0%,这样可以抑制潜在的扩缩容操作。

此外,如果存在未达到Ready状态的Pod,并且系统原本会在不考虑缺失指标或NotReady的Pod情况下进行扩展,则系统仍然会保守地假设这些Pod消耗期望指标值的0%,从而进一步抑制扩容操作。

如果在HorizontalPodAutoscaler中设置了多个指标,系统就会对每个指标都执行上面的算法,在全部结果中以期望副本数的最大值为最终结果。如果这些指标中的任意一个都无法转换为期望的副本数(例如无法获取指标的值),系统就会跳过扩缩容操作。

最后,在HPA控制器执行扩缩容操作之前,系统会记录扩缩容建议信息(Scale Recommendation)。控制器会在操作时间窗口(时间范围可以配置)中考虑所有的建议信息,并从中选择得分最高的建议。这个值可通过kube-controller-manager服务的启动参数--horizontal-pod-autoscaler-downscale-stabilization-window进行配置,默认值为5min。这个配置可以让系统更为平滑地进行缩容操作,从而消除短时间内指标值快速波动产生的影响。

Kubernetes将 HorizontalPodAutoscaler资源对象 提供给用户来定义扩缩容的规则。

HorizontalPodAutoscaler资源对象处于Kubernetes的API组“ autoscaling ”中,目前包括 v1 和 v2 两个版本

其中 autoscaling/v1 仅支持 基于CPU使用率 的 自动扩缩容 , autoscaling/v2 则用于支持基于 任意指标 的自动扩缩容配置,包括基于资源使用率、Pod指标、其他指标等类型的指标数据,当前版本为 autoscaling/v2beta2 。

下面对HorizontalPodAutoscaler的配置和用法进行说明。

(1)基于 autoscaling/v1 版本的HorizontalPodAutoscaler配置, 仅可以设置CPU使用率 :

主要参数如下

为了使用 autoscaling/v1 版本的HorizontalPodAutoscaler,需要 预先安装Heapster组件 或 Metrics Server ,用于 采集Pod的CPU使用率 。

Heapster 从Kubernetes 1.11版本开始进入 弃用阶段 ,不再对Heapster进行详细说明。

(2)基于 autoscaling/v2beta2 的HorizontalPodAutoscaler配置:

主要参数如下。

可以将metrics中的 type(指标类型 )设置为以下三种,可以设置一个或多个组合,如下所述。

(1) Resource :基于 资源的指标值 ,可以设置的资源为 CPU 和 内存 。

(2) Pods :基于 Pod的指标 ,系统将对全部Pod副本的指标值进行 平均值计算 。

(3) Object :基于某种资源对象(如Ingress)的指标或应用系统的任意自定义指标。

Resource类型 的指标可以设置 CPU 和 内存 。

指标数据可以通过API“ metrics.k8s.io ”进行查询,要求 预先启动Metrics Server服务 。

Pods类型 和 Object类型 都属于 自定义指标类型 ,指标的数据通常需要搭建自定义Metrics Server和监控工具进行采集和处理。指标数据可以通过API“custom.metrics.k8s.io”进行查询,要求预先启动自定义Metrics Server服务。

类型为Pods 的指标数据来源于 Pod对象本身 ,其target指标类型 只能使用AverageValue ,示例如下:

其中,设置Pod的 指标名 为 packets-per-second ,在目标指标平均值为1000时触发扩缩容操作。

类型为 Object 的指标数据来源于 其他资源对象 或 任意自定义指标 ,其target指标类型可以使用 Value 或 AverageValue (根据 Pod副本数计算平均值 )进行设置。下面对几种常见的自定义指标给出示例和说明。

例1,设置指标的名称为requests-per-second,其值来源于Ingress “main-route”,将目标值(value)设置为2000,即在Ingress的每秒请求数量达到2000个时触发扩缩容操作:

***隐藏网址***

还可以在同一个HorizontalPodAutoscaler资源对象中定义多个类型的指标,系统将针对每种类型的指标都计算Pod副本的目标数量,以最大值为准进行扩缩容操作。例如:

从1.10版本开始,Kubernetes引入了对外部系统指标的支持。例如,用户使用了公有云服务商提供的消息服务或外部负载均衡器,希望基于这些外部服务的性能指标(如消息服务的队列长度、负载均衡器的QPS)对自己部署在Kubernetes中的服务进行自动扩缩容操作。这时,就可以在metrics参数部分设置type为External来设置自定义指标,然后就可以通过API“external.metrics.k8s.io”查询指标数据了。当然,这同样要求自定义Metrics Server服务已正常工作。

例3,设置指标的名称为queue_messages_ready,具有queue=worker_tasks标签在目标指标平均值为30时触发自动扩缩容操作:

在使用外部服务的指标时,要安装、部署能够对接到Kubernetes HPA模型的监控系统,并且完全了解监控系统采集这些指标的机制,后续的自动扩缩容操作才能完成。

Kubernetes 推荐 尽量使用 type为Object 的 HPA配置方式 ,这可以通过使用Operator模式,将外部指标通过CRD(自定义资源)定义为API资源对象来实现。

通过一个完整的示例,对如何搭建和使用基于自定义指标的HPA体系进行说明。

基于自定义指标进行自动扩缩容时,需要 预先部署自定义Metrics Server ,目前可以使用基于 Prometheus 、 Microsoft Azure 、 Datadog Cluster 等系统的Adapter实现自定义Metrics Server,未来还将提供基于 Google Stackdriver***隐藏网址***

基于Prometheus监控系统对HPA的基础组件部署和HPA配置进行详细说明。

基于Prometheus的HPA架构如图

关键组件包括如下:

接下来对整个系统的部署过程进行说明。

(1)在Master的API Server启动Aggregation层,通过设置kube-apiserver服务的下列启动参数进行开启。

配置kube-controller-manager服务中HPA的相关启动参数(可选配置)如下。

(2)部署Prometheus,这里使用Operator模式进行部署。

首先,使用下面的YAML配置文件部署prometheus-operator:

英语翻译If you are worried about things and are under a lot of stress

如果你担心的事情是在工作或学校下了很大的压力,那么你可能睡不好。担心可以让你醒了,在床上辗转反侧,直到凌晨的早晨,你最终入睡。当你醒来时,你不会感到神清气爽,累了,累死了,无法面对新的一天。在最近的新闻报道,题为“压力与睡眠”,亨利·温克尔博士表示:“我们更担心,我们睡的少,就越是无法处理压力。如果我们能够找到一种方式来获得一个良好的夜间睡眠,”他补充说,“ 我们经常可以发现有什么担心的精力,来对付。”那么,什么是一个良好的睡眠呢?研究表明,睡眠时间的长短,以保持健康的人们需要有很大不同。七个小时是平均量,但奇怪的是,睡觉不再经常让你很头疼,而不是让你感觉更清爽。温克尔博士认为,睡觉是很重要的。工作到很晚的人应尽量给自己一个短暂的休息或宁静地在睡前做一些事情。这可以是看电视或听音乐。也可以在当天早些的时候做一些运动,帮助你在身体以及精神上得到舒缓。另外,睡前喝水也可以帮助,但应避免咖啡或茶,因为它们含有咖啡因和你保持清醒。

求my fair lady 中文剧本

Higgins is asked by the morally-responsible Pickering if he will take advantage of Eliza under the circumstances: "I hope it’s clearly understood that no advantage is to be taken of her position...This is no trifling matter. Are you a man of good character where women are concerned?" The confirmed, aloof, hyper-logical bachelor/professor expresses his feelings about women in words and song: "I find the moment that a woman makes friends with me, she becomes jealous, exacting, suspicious, and a damned nuisance. And I find the moment that I make friends with a woman, I become selfish and tyrannical. So here I am, a confirmed old bachelor, and likely to remain so." The snobbish professor contemptuously sings-talks that he is a "quiet living man" without the need for a woman in "An Ordinary Man": I’m an ordinary man; Who desires nothing more Than just the ordinary chance To live exactly as he likes And do precisely what he wants. An average man am I, Of no eccentric whim; Who likes to live his life Free of strife, Doing whatever he thinks is best for him. Just an ordinary man. But let a woman in your life And your serenity is through! She’ll redecorate your home, From the cellar to the dome; Then go on to the enthralling Fun of overhauling You. Oh, let a woman in your life And you are up against the wall! Make a plan and you will find She has something else in mind; And so rather than do either You do something else that neither Likes at all. You want to talk of Keats or Milton; She only wants to talk of love. You go to see a play or ballet, And spend it searching for her glove. Oh, let a woman in your life And you invite eternal strife! Let them buy their wedding bands For those anxious little hands; I’d be equally as willing For a dentist to be drilling Than to ever let a woman in my life! I’m a very gentle man; Even-tempered and good-natured, Whom you never hear complain; Who has the milk of human kindness By the quart in ev’ry vein. A patient man am I Down to my fingertips; The sort who never could, Ever would, Let an insulting remark escape his lips. Just a very gentle man. But let a woman in your life And patience hasn’t got a chance. She will beg you for advice; Your reply will be concise. And she’ll listen very nicely Then go out and do precisely What she wants! You were a man of grace and polish Who never spoke above a hush. Now all at once you’re using language That would make a sailor blush. Oh, let a woman in your life And you’re plunging in a knife! Let the others of my sex Tie the knot - around their necks; I’d prefer a new edition Of the Spanish Inquisition Than to ever let a woman in my life! I’m a quiet living man Who prefers to spend the evenings In the silence of his room; Who likes an atmosphere as restful As an undiscovered tomb. A pensive man am I Of philosophic joys; Who likes to meditate, Contemplate, Free from humanity’s mad, inhuman noise. Just a quiet living man. But let a woman in your life And your sabbatical is through! In a line that never ends Come an army of her friends; Come to jabber and to chatter And to tell her what the matter is with you. She ’ll have a booming, boist’rous fam’ly Who will descend on you en masse. She’ll have a large Wagnerian mother With a voice that shatters glass! Oh, let a woman in your life. . . Let a woman in your life . . . Let a woman in your life . . . I shall never let a woman in my life!中文:希金斯是要求在道义上负责的皮克林,如果他将利用艾丽莎的情况下: “我希望它的清楚明白,没有好处,是要考虑她的立场… …这是没有儿戏。你是一名男子的品格良好,妇女关注的“ ?经证实,超然,超逻辑学士/教授表示,他的感受,妇女在言词上和歌: “我觉得目前有一名女子,使朋友与我,她成为嫉妒,严格的,可疑,和该死的滋扰。我觉得目前,我广交朋友,与一名女子,我变得自私和暴虐,所以我在这里时,证实岁的学士学位,并可能继续如此“ 。该势利教授会唱会谈,他是一个“安静的生活好男人” ,而不需要一名女子在“一个普通的人” : 我是一个普通人; 谁没有更多的欲望不仅仅是普通的机会生活完全一样,他喜欢和这样做正是他想要什么。 平均男子我, 不偏心随意; 谁喜欢住他的生命免费的内乱, 做什么,他认为是最好的他。 只是一个普通的人。 但让一名女子在你的生活和你的平静是通过! 她将顶起你的家, 从地窖到圆顶; 然后再对向困难,有趣的检修您。哦,让一名女子在你的生活你对墙! 作出计划和你会发现她的东西,否则在铭记; 所以,而非任你做点事,否则,无论是喜欢在所有。 您想要交谈的济慈或米尔顿; 她只是想谈爱情。 你去看到一出戏或芭蕾舞, 和消费,它寻找她的手套。 哦,让一名女子在你的生活和您邀请的永恒的争斗! 让他们买他们的婚礼乐队对于那些急欲小手; 我要同样愿意为一名牙医要钻探比以往任何时候都让一名女子在我的生命! 我是一个非常轻柔的男子; 甚至-锻炼和良好的本质, 其中,你永远不会听到抱怨; 谁拥有牛奶人类爱心由夸脱在到静脉。 病人的男子我到我的指尖; 排序从来没有谁可以, 以往任何时候都将, 让一个侮辱性的言论,逃脱他的嘴唇。 只是一个很温柔的男子。 但让一名女子在你的生活和耐心,并没有得到一个机会。 她会乞求你的意见; 你的答复,将简洁。 和她会听很漂亮然后走出去,这样做正是她想! 你是一名男子的宽限期和波兰谁从来没有以上述。 现在,所有在一旦您使用的语言这将使水手绯红。 哦,让一名女子在你的生活和您投身在刀! 让其他人我的性别结同心-靠近他们的脖子上; 我更希望的一个新版本该西班牙宗教裁判所比以往任何时候都让一名女子在我的生命! 我一个安静的生活男子谁喜欢花,晚上在沉默的他的房间; 谁喜欢的气氛作为休息作为一个未被发现的墓。 一男子告诉我哲学的乐趣; 谁喜欢冥想, 争议, 免费从人类的疯狂,不人道的噪音。 只是一个安静的生活的男子。 但让一名女子在你的生活和您的休假是通过! 在路线,从来没有完来军队她的朋友; 来的突然和颤振并告诉她,什么事是与您联系。 她将为有一个蓬勃发展,幸福美满的家庭。 谁将会下降,你就大举。 她将有一个大伟无私的母亲与声音打破玻璃! 哦,让女人在你的生活..... 让一女在你的生活..... 让一名女子在你的生活......我将永远不会让一名女子在我的生命!

what’s to become of me(my fair lady台词)

你想做干什麽呢??Higgins is asked by the morally-responsible Pickering if he will take advantage of Eliza under the circumstances: "I hope it’s clearly understood that no advantage is to be taken of her position...This is no trifling matter. Are you a man of good character where women are concerned?" The confirmed, aloof, hyper-logical bachelor/professor expresses his feelings about women in words and song: "I find the moment that a woman makes friends with me, she becomes jealous, exacting, suspicious, and a damned nuisance. And I find the moment that I make friends with a woman, I become selfish and tyrannical. So here I am, a confirmed old bachelor, and likely to remain so." The snobbish professor contemptuously sings-talks that he is a "quiet living man" without the need for a woman in "An Ordinary Man": I’m an ordinary man; Who desires nothing more Than just the ordinary chance To live exactly as he likes And do precisely what he wants. An average man am I, Of no eccentric whim; Who likes to live his life Free of strife, Doing whatever he thinks is best for him. Just an ordinary man. But let a woman in your life And your serenity is through! She’ll redecorate your home, From the cellar to the dome; Then go on to the enthralling Fun of overhauling You. Oh, let a woman in your life And you are up against the wall! Make a plan and you will find She has something else in mind; And so rather than do either You do something else that neither Likes at all. You want to talk of Keats or Milton; She only wants to talk of love. You go to see a play or ballet, And spend it searching for her glove. Oh, let a woman in your life And you invite eternal strife! Let them buy their wedding bands For those anxious little hands; I’d be equally as willing For a dentist to be drilling Than to ever let a woman in my life! I’m a very gentle man; Even-tempered and good-natured, Whom you never hear complain; Who has the milk of human kindness By the quart in ev’ry vein. A patient man am I Down to my fingertips; The sort who never could, Ever would, Let an insulting remark escape his lips. Just a very gentle man. But let a woman in your life And patience hasn’t got a chance. She will beg you for advice; Your reply will be concise. And she’ll listen very nicely Then go out and do precisely What she wants! You were a man of grace and polish Who never spoke above a hush. Now all at once you’re using language That would make a sailor blush. Oh, let a woman in your life And you’re plunging in a knife! Let the others of my sex Tie the knot - around their necks; I’d prefer a new edition Of the Spanish Inquisition Than to ever let a woman in my life! I’m a quiet living man Who prefers to spend the evenings In the silence of his room; Who likes an atmosphere as restful As an undiscovered tomb. A pensive man am I Of philosophic joys; Who likes to meditate, Contemplate, Free from humanity’s mad, inhuman noise. Just a quiet living man. But let a woman in your life And your sabbatical is through! In a line that never ends Come an army of her friends; Come to jabber and to chatter And to tell her what the matter is with you. She ’ll have a booming, boist’rous fam’ly Who will descend on you en masse. She’ll have a large Wagnerian mother With a voice that shatters glass! Oh, let a woman in your life. . . Let a woman in your life . . . Let a woman in your life . . . I shall never let a woman in my life! 翻译??希金斯是道义上的要求,负责皮克林,如果他将利用艾丽莎在这种情况下: “我希望这是明确的理解,没有任何的优势是必须考虑到她的立场...这绝不是儿戏。你的人品行端正,妇女关心? “经确认,超然,超逻辑学士/教授表示感想妇女文字和歌: “我觉得现在的妇女朋友,我让她变得嫉妒,严格,可疑,和该死的滋扰。我发现此刻,我结交了一个女人,我变得自私和暴虐。所以我在这里,确认老单身汉,并可能会继续如此。 “教授轻蔑的势利唱讲座,他是一个“平静生活的人” ,而不需要一个女人在“普通人” : 我是一个普通人; 谁的愿望而已不仅仅是普通的机会生活完全一样,他喜欢做正是他想。 平均男子我, 没有偏心随心所欲; 谁喜欢他的生活方式自由的斗争, 做什么,他认为最适合他。 只是一个普通的人。 但是,让一个女人在你的生活和你的平静是通过! 她会续借你的家, 从地窖里的穹顶; 然后前往扣人心弦有趣的检修您。 噢,让一个女人在你的生活和你面对的墙上! 制定一个计划,你会发现她有别的考虑; 等等,而不是操作之一你做些别的事情,无论喜欢在所有。 您想要交谈济慈或米尔顿; 她只是想谈的爱情。 你去看话剧或芭蕾舞, 花它寻找她的手套。 噢,让一个女人在你的生活和您邀请的永恒争斗! 让他们购买自己的婚礼乐队对于那些急于小手; 我会同样愿意为牙医的钻比以往任何时候都让一个女人在我的生命!谁的牛奶人类善良

文章分享结束,restful average和Pod的扩缩容的答案你都知道了吗?欢迎再次光临本站哦!


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3